//
//  AMMenuButton.m
//  WeiDu_1_0
//
//  Created by foguo-mac-1 on 01/07/16.
//  Copyright (c) 2016 WeiDu Energy Tech. All rights reserved.
//

#import "HOMenuButton.h"

@implementation HOMenuButton
@synthesize delegate;
@synthesize targetView;

- (instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame])
    {
        [self addTarget:self action:@selector(didClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

-(BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
    if (action == @selector(selDomain:))
    {
        return YES;
    }
    if (action == @selector(selWhois:))
    {
        return YES;
    }
    return NO;
}

- (void)selWhois:(id)sender
{
    if([self.delegate respondsToSelector:@selector(selWhoisFromMenu:)])
    {
        [self.delegate selWhoisFromMenu:sender];
    }
}

- (void)selDomain:(id)sender
{
    if([self.delegate respondsToSelector:@selector(selDomainFromMenu:)])
    {
        [self.delegate selDomainFromMenu:sender];
    }
}

-(BOOL)canBecomeFirstResponder
{
    return YES;
}

- (void)didClick:(id)sender
{
}



@end
